<div >
<h2><?php  echo __('Ecategory');?></h2>
	<dl>
		
		<dt><?php echo __('Name'); ?></dt>
		<dd>
			<?php echo h($ecategory['Ecategory']['name']); ?>
			&nbsp;
		</dd>
		
	</dl>
</div>
<br />
<div class="related">
	<h3><?php echo __('Related Events');?></h3>
	<?php if (!empty($ecategory['Event'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Name'); ?></th>
		<th><?php echo __('Start Date'); ?></th>
		<th><?php echo __('End Date'); ?></th>

		<th class="actions"><?php echo __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($ecategory['Event'] as $event): ?>
		<tr>
			<td><?php echo $event['id'];?></td>
			<td><?php echo $event['name'];?></td>
		<td><?php echo $event['start_date'];?></td>
			<td><?php echo $event['end_date'];?></td>
		<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'events', 'action' => 'view_public_event', $event['id'])); ?>
                <?php 
				if($event['user_id']==$this->UserAuth->getUserId()){?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'events', 'action' => 'edit_public', $event['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'events', 'action' => 'delete', $event['id']), null, __('Are you sure you want to delete # %s?', $event['id'])); ?>
                <?php 
				}
				?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>